{__NOLAYOUT__}
<Widget:show col="12" title="">
<form method="post" valid action="{$updateUrl}">
<input type="hidden" name="table" value="{$table}" />
<input type="hidden" name="field" value="{$vo.name}" />
<input type="hidden" name="name" value="{$vo.name}" />
<div class="row">
    <Ui:field col="12" value="{$vo.title}" label="显示标题" name="title" ></Ui:field>
    <Ui:field col="8" hideipt="true" label="数据类型"  >
        <select data-value="{$vo.type}" class="form-control" name="type">
            <option value="text">text</option>
            <option value="ueditor">ueditor</option>
            <option value="textarea">textarea</option>
            <option value="richrext">richrext</option>
            <option value="String">String</option>
            <option value="number">Number</option>
            <option value="boolean">Boolean</option>
            <option value="date">Date</option>
            <option value="file">File</option>
            <option value="array">Array</option>
            <option value="object">Object</option>
            <option value="pointer">Pointer</option>
            <option value="relation">Relation</option>
        </select>
    </Ui:field>
    <Ui:field col="4" tip="请输入关联的模型" colcls="pointer hide" value="{$vo.pointer}" label="Pointer" name="pointer" ></Ui:field>
    <div class="clearfix"></div>

    <Ui:field col="3" hideipt="true" label="搜索字段"  >
        <select data-value="{$vo.search}" class="form-control" name="search">
            <option value="1">显示</option>
            <option value="0">不显示</option>
        </select>
    </Ui:field>

    <Ui:field col="3" hideipt="true" label="列表页显示"  >
        <select data-value="{$vo.showList}" class="form-control" name="showList">
            <option value="1">显示</option>
            <option value="0">不显示</option>
        </select>
    </Ui:field>

    <Ui:field col="3" hideipt="true" label="新增页显示"  >
        <select data-value="{$vo.showAdd}" class="form-control" name="showAdd">
            <option value="1">显示</option>
            <option value="0">不显示</option>
        </select>
    </Ui:field>
    <Ui:field col="3" hideipt="true" label="修改页显示"  >
        <select data-value="{$vo.showEdit}" class="form-control" name="showEdit">
            <option value="1">显示</option>
            <option value="0">不显示</option>
        </select>
    </Ui:field>
    <Ui:field col="12" value="{$vo.intro}" label="备注" name="intro" ></Ui:field>
</div>

</form>
</Widget:show>
<script type="text/javascript">
$(function(){
    $('select[data-value]').each(function(i,d){
        var v = $(this).data('value');
        $(this).val(v);
    })
    var p = $('[name=type]').val();
    if(p == 'pointer')
    {
        $('.pointer').removeClass('hide');
    }else{
        $('[name=pointer]').val('');
        $('.pointer').addClass('hide');
    }

    $('[name=type]').on('change',function(){
        var v = $(this).val();
        if(v == 'pointer')
        {
            $('.pointer').removeClass('hide');
        }else{
            $('[name=pointer]').val('');
            $('.pointer').addClass('hide');
        }
    })
})    
</script>
